package main

import (
	"fmt"
	"reflect"
)

type Args struct {
	A, B int
}

func trapSlice() {

	arr := []int{1, 2, 3, 4}
	slice := arr[1:3]
	slice = append(slice, 6, 7)

	Type := reflect.ValueOf(slice).Type()

	fmt.Println(slice)
	fmt.Println(arr)
	fmt.Println(Type)

}

func trapChan() {

	ch := make(chan Args, 3)

	for i := 0; i < 3; i++ {
		go func(i int) {

			ch <- Args{1, i}

		}(i)
	}

	select {
	case result := <-ch:
		fmt.Println(result)
	}

}

func inter(g interface{}) {

	_, ok := g.(*Args)
	fmt.Println(ok)

}

func main() {

	// trapSlice()
	// trapChan()
	//var str interface{}

	str := &Args{}

	// str.A = 1
	// str.B = 2

	inter(str)
}
